Skip to content

Conversation

jbrockmendel
Copy link
Member

@mroeschke mroeschke added the Arrow pyarrow functionality label Sep 8, 2025
@mroeschke mroeschke added this to the 3.0 milestone Sep 8, 2025
import pyarrow as pa

pa_dtype = dtype.pyarrow_dtype
if not pa.types.is_timestamp(pa_dtype):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if not pa.types.is_timestamp(pa_dtype):
if dtype.kind != "M":

Would allow you to avoid the pyarrow import

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call, will update

if isinstance(dtype, ArrowDtype):
import pyarrow as pa

return pa.types.is_duration(dtype.pyarrow_dtype)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comment here

@mroeschke mroeschke merged commit 0bc7ea3 into pandas-dev:main Sep 8, 2025
38 checks passed
@mroeschke
Copy link
Member

Thanks @jbrockmendel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arrow pyarrow functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: DatetimeIndex.get_indexer(timestamp[pyarrow]) BUG: PyArrow timestamp type does not work with map() function

2 participants